package com.cloud.config;

import org.apache.catalina.filters.HttpHeaderSecurityFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author: create by God of SJF
 * @version: v1.0
 * @description: com.cloud.config
 * @date:2021/5/21
 */
@Configuration
public class XFSConfiguration {

    @Bean
    public FilterRegistrationBean XFS() {
        FilterRegistrationBean bean = new FilterRegistrationBean();
        HttpHeaderSecurityFilter filter = new HttpHeaderSecurityFilter();
        filter.setAntiClickJackingOption("SAMEORIGIN");
        bean.setFilter(filter);
        return bean;
    }
}
